///*     */ package com.iris.egrant.web.struts2.tags;
///*     */
///*     */ import com.iris.egrant.component.service.SearchService;
///*     */ import com.iris.egrant.remote.http.service.ServiceFactory;
///*     */ import com.iris.egrant.security.springsecurity.SecurityUtils;
///*     */ import com.iris.egrant.system.model.Organization;
///*     */ import com.iris.egrant.system.model.OrganizationExtend;
///*     */ import com.iris.egrant.system.model.PersonExtend;
///*     */ import com.iris.egrant.app.utils.IrisStringUtils;
///*     */ import com.iris.egrant.utils.XMLHelper;
///*     */ import com.iris.egrant.utils.date.DateUtils;
///*     */ import freemarker.template.Configuration;
///*     */ import freemarker.template.Template;
///*     */ import java.io.Writer;
///*     */ import java.text.DateFormat;
///*     */ import java.text.SimpleDateFormat;
///*     */ import java.util.Date;
///*     */ import java.util.HashMap;
///*     */ import java.util.List;
///*     */ import java.util.Map;
///*     */ import javax.servlet.jsp.JspException;
///*     */ import javax.servlet.jsp.tagext.BodyTagSupport;
///*     */ import org.apache.commons.collections.MapUtils;
///*     */ import org.apache.commons.lang3.ObjectUtils;
///*     */ import org.apache.commons.lang3.StringUtils;
///*     */ import org.dom4j.Document;
///*     */ import org.springframework.web.context.WebApplicationContext;
///*     */ import org.springframework.web.context.support.WebApplicationContextUtils;
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */ public class AttachTag
///*     */   extends BodyTagSupport
///*     */ {
///*     */   private static final long serialVersionUID = 1077194066541229822L;
///*     */   private String grantCode;
///*     */   private String formCode;
///*     */   private String natureValue;
///*     */   private String status;
///*     */   private String xmlData;
///*     */   private String attachType;
///*     */   private String tableId;
///*     */   private String title;
///*     */   private String orgCode;
///*     */   private Document orgDoc;
///*     */   private Document psnDoc;
///*     */   private String psnCode;
///*  57 */   private static Map<String, Object> transform = new HashMap<String, Object>(); static {
///*  58 */     transform.put("14", "8");
///*  59 */     transform.put("6", "8");
///*  60 */     transform.put("5", "8");
///*  61 */     transform.put("4", "15");
///*  62 */     transform.put("13", "16");
///*     */   }
///*     */
///*     */
///*     */
///*     */   public int doStartTag() throws JspException {
///*  68 */     WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(this.pageContext.getServletContext());
///*     */
///*  70 */     Configuration cptFreemarkereConfiguration = (Configuration)ctx.getBean("cptFreemarkereConfiguration");
///*     */
///*  72 */     ServiceFactory serviceFactory = (ServiceFactory)ctx.getBean("serviceFactory");
///*  73 */     if (IrisStringUtils.isNullOrBlank(this.attachType)) {
///*  74 */       this.attachType = "proposal";
///*     */     }
///*  76 */     if (IrisStringUtils.isNullOrBlank(this.natureValue)) {
///*  77 */       this.natureValue = "A";
///*     */     }
///*  79 */     List<Map<String, Object>> mapList = ((SearchService)serviceFactory.getService(SearchService.class)).findPrpAttach(this.grantCode, this.formCode, this.natureValue, this.attachType, "1");
///*  80 */     if (mapList.size() == 0 && !IrisStringUtils.isNullOrBlank(this.grantCode)) {
///*  81 */       mapList = ((SearchService)serviceFactory.getService(SearchService.class)).findPrpAttach(this.grantCode, "", this.natureValue, this.attachType, "3");
///*     */     }
///*  83 */     if (mapList.size() == 0 && !IrisStringUtils.isNullOrBlank(this.formCode)) {
///*  84 */       mapList = ((SearchService)serviceFactory.getService(SearchService.class)).findPrpAttach("", this.formCode, this.natureValue, this.attachType, "2");
///*     */     }
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */     try {
///*  92 */       Map<String, Object> rootMap = new HashMap<String, Object>();
///*     */
///*  94 */       String res = (String)this.pageContext.getAttribute("res");
///*  95 */       rootMap.put("res", res);
///*     */
///*  97 */       Template template = cptFreemarkereConfiguration.getTemplate("prpAttach.ftl", "utf-8");
///*  98 */       rootMap.put("content", render(mapList));
///*     */
///* 100 */       template.process(rootMap, (Writer)this.pageContext.getOut());
///*     */     }
///* 102 */     catch (Exception e) {
///* 103 */       throw new JspException(e);
///*     */     }
///*     */
///* 106 */     return 0;
///*     */   }
///*     */
///*     */   private String render(List<Map<String, Object>> mapList) throws Exception {
///* 110 */     String res = (String)this.pageContext.getAttribute("res");
///* 111 */     WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(this.pageContext.getServletContext());
///* 112 */     ServiceFactory serviceFactory = (ServiceFactory)ctx.getBean("serviceFactory");
///*     */
///* 114 */     String unitNature = "0";
///* 115 */     if (mapList.size() > 0) {
///* 116 */       this.attachType = MapUtils.getString(mapList.get(0), "ATTACH_TYPE");
///* 117 */       unitNature = MapUtils.getString(mapList.get(0), "UNIT_NATURE");
///*     */     }
///* 119 */     StringBuffer tbHtml = new StringBuffer();
///* 120 */     tbHtml.append("<script type=\"text/javascript\">");
///*     */
///* 122 */     if ("organization".equals(this.attachType)) {
///* 123 */       tbHtml.append(" function prp_attach_" + unitNature + "(){ ");
///*     */     } else {
///* 125 */       tbHtml.append(" function prp_attach(){ ");
///*     */     }
///* 127 */     for (Map<String, Object> map2 : mapList) {
///* 128 */       String CHECK_TYPE = (map2.get("CHECK_TYPE") == null) ? "''" : map2.get("CHECK_TYPE").toString();
///* 129 */       String inheritAttachCode = (map2.get("INHERIT_ATTACH_CODE") == null) ? "''" : map2.get("INHERIT_ATTACH_CODE").toString();
///* 130 */       String CHECK_TIME = (map2.get("CHECK_TIME") == null) ? "''" : map2.get("CHECK_TIME").toString();
///* 131 */       String ATTACHCODE = (map2.get("ATTACHCODE") == null) ? "''" : map2.get("ATTACHCODE").toString();
///* 132 */       String function = IrisStringUtils.toString(MapUtils.getString(map2, "FUNCTION"));
///* 133 */       String type = IrisStringUtils.toString(MapUtils.getString(map2, "TYPE"));
///* 134 */       String inheritSource = IrisStringUtils.toString(MapUtils.getString(map2, "INHERIT_SOURCE"));
///* 135 */       if (map2.get("CHECK_TYPE") != null && (map2.get("BERIF").toString().equalsIgnoreCase("1") || (map2.get("BERIF").toString().equalsIgnoreCase("2") && this.natureValue.substring(0, 1).equalsIgnoreCase("A"))))
///*     */       {
///*     */
///*     */
///*     */
///* 140 */         tbHtml.append("checkAttach('" + IrisStringUtils.toString(this.title) + "'," + ATTACHCODE + "," + type + "," + CHECK_TYPE + "," + CHECK_TIME + "," + SecurityUtils.getCurrentUserRoleId() + "); ");
///*     */       }
///*     */
///*     */
///*     */
///* 145 */       if (map2.get("BERIF").toString().equalsIgnoreCase("3") && !IrisStringUtils.isNullOrBlank(function)) {
///* 146 */         function = function.replaceAll("，", ",").replaceAll("；", ";").replaceAll("“", "\"").replaceAll("”", "\"").replaceAll("（", "(").replaceAll("）", ")");
///* 147 */         function = function.substring(0, function.lastIndexOf(")"));
///*     */
///*     */
///*     */
///* 151 */         tbHtml.append(function + ",'" + IrisStringUtils.toString(this.title) + "'," + ATTACHCODE + "," + type + "," + CHECK_TYPE + "," + CHECK_TIME + "," + SecurityUtils.getCurrentUserRoleId() + "); ");
///*     */       }
///*     */
///*     */
///*     */
///* 156 */       if (!"organization".equals(this.attachType) && "organization".equals(inheritSource) && !IrisStringUtils.isNullOrBlank(inheritAttachCode)) {
///*     */
///* 158 */         this.orgCode = XMLHelper.getNodeValueFromXML(XMLHelper.parseDocument(this.xmlData), "/data/organizations/organization[@submit_org='1']/org_code");
///*     */
///*     */
///*     */
///* 162 */         OrganizationExtend orgExtend = ((SearchService)serviceFactory.getService(SearchService.class)).findOrganizationExtend(this.orgCode);
///* 163 */         this.orgDoc = XMLHelper.parseDoc(orgExtend.getExtInfo());
///*     */       }
///*     */
///* 166 */       if (!"organization".equals(this.attachType) && this.psnDoc == null && "person".equals(inheritSource) && !IrisStringUtils.isNullOrBlank(inheritAttachCode)) {
///* 167 */         if (IrisStringUtils.isNullOrBlank(this.psnCode)) {
///* 168 */           this.psnCode = IrisStringUtils.toString(SecurityUtils.getCurrentUserId());
///*     */         }
///* 170 */         PersonExtend psnExtend = ((SearchService)serviceFactory.getService(SearchService.class)).findPersonExtend(this.psnCode);
///* 171 */         this.psnDoc = XMLHelper.parseDoc(psnExtend.getExtInfo());
///*     */       }
///*     */     }
///* 174 */     tbHtml.append(" }</script>");
///*     */
///*     */
///* 177 */     Document doc = XMLHelper.parseDocument(this.xmlData);
///* 178 */     for (int i = 0; i < mapList.size(); i++) {
///* 179 */       Map<String, Object> map = mapList.get(i);
///* 180 */       String style = "";
///* 181 */       String type = map.get("TYPE").toString();
///* 182 */       String berif = map.get("BERIF").toString();
///* 183 */       String inherit_attach_code = "";
///* 184 */       String index = map.get("ATTACHCODE").toString();
///* 185 */       String attachCode = map.get("ATTACHCODE").toString();
///* 186 */       String seq_no = map.get("SEQNO").toString();
///* 187 */       String isSplit = IrisStringUtils.toString(MapUtils.getString(map, "IS_SPLIT"));
///* 188 */       if (Long.parseLong(seq_no) < 10L) {
///* 189 */         seq_no = "0" + seq_no;
///*     */       }
///* 191 */       List<Map<String, Object>> attachTemplates = ((SearchService)serviceFactory.getService(SearchService.class)).getAttachTemplateList(Long.valueOf(attachCode));
///*     */
///* 193 */       String file_code = "";
///* 194 */       String entity_file_name = "";
///* 195 */       String file_date = "";
///* 196 */       String orgType = "";
///* 197 */       if (this.natureValue.substring(0, 1).equalsIgnoreCase("A")) {
///* 198 */         orgType = "qy";
///*     */       } else {
///* 200 */         orgType = "sy";
///*     */       }
///* 202 */       if ("organization".equalsIgnoreCase(this.attachType)) {
///* 203 */         String seq_no2 = map.get("SEQ_NO").toString();
///* 204 */         Long seqNo2 = Long.valueOf(Long.parseLong(seq_no2));
///* 205 */         if (seqNo2.longValue() < 10L) {
///* 206 */           seq_no2 = "0" + seqNo2;
///*     */         }
///* 208 */         index = ObjectUtils.toString(Long.valueOf(seqNo2.longValue() + 1L));
///*     */
///* 210 */         String file_code1 = XMLHelper.getNodeValueFromXML(doc, "/data/org_attachs/org_attach[@seq_no=" + index + "]/file_code");
///* 211 */         String file_name1 = XMLHelper.getNodeValueFromXML(doc, "/data/org_attachs/org_attach[@seq_no=" + index + "]/entity_file_name");
///* 212 */         String file_date1 = XMLHelper.getNodeValueFromXML(doc, "/data/org_attachs/org_attach[@seq_no=" + index + "]/file_date");
///*     */
///*     */
///* 215 */         long SEQNO = Long.parseLong(map.get("SEQNO").toString()) + 1L;
///* 216 */         tbHtml.append("<tr><input type=\"hidden\" id=\"seq_no_" + index + "\" name=\"org_attachs/org_attach[" + seq_no2 + "]@seq_no\" value=" + index + " /><input type=\"hidden\" name=\"org_attachs/org_attach[" + seq_no2 + "]@type\" value=" + orgType + " /><td  style=\"text-align:center\"><span id=\"attach_seq" + index + "\">" + SEQNO + "</span></td>");
///*     */
///*     */
///*     */
///*     */
///* 221 */         tbHtml.append("<td><span id=\"name" + index + "\" name='org_attachs/org_attach[" + seq_no2 + "]/attachtype_name'>" + map.get("ATTACH_NAME").toString() + "</span><span name=\"org_attachs/org_attach[" + seq_no2 + "]/check_describe\" style=\"display:none\"  id=\"check_describe" + index + "\">" + IrisStringUtils.toString(MapUtils.getString(map, "CHECK_DESCRIBE")) + "</span>");
///*     */
///*     */
///* 224 */         tbHtml.append(getAttachTemplatesHtml(this.attachType, index, seq_no2, attachTemplates, MapUtils.getString(map, "SAMPLE_WORD"), MapUtils.getString(map, "SAMPLE_DESCRIBE"), res));
///*     */
///* 226 */         tbHtml.append("</td>");
///*     */
///*     */
///*     */
///*     */
///* 231 */         if (berif.equalsIgnoreCase("1") || (berif.equalsIgnoreCase("2") && this.natureValue.substring(0, 1).equalsIgnoreCase("A"))) {
///* 232 */           tbHtml.append("<td style=\"text-align:center\"><span id=\"berif" + index + "\" name=\"org_attachs/org_attach[" + seq_no2 + "]/berif\">是</span></td>");
///* 233 */         } else if (berif.equalsIgnoreCase("3")) {
///* 234 */           tbHtml.append("<td style=\"text-align:center\"><span id=\"berif" + index + "\" name=\"org_attachs/org_attach[" + seq_no2 + "]/berif\">条件判断 </span></td>");
///*     */         } else {
///* 236 */           tbHtml.append("<td style=\"text-align:center\"><span id=\"berif" + index + "\" name=\"org_attachs/org_attach[" + seq_no2 + "]/berif\">否</span></td>");
///*     */         }
///*     */
///*     */
///*     */
///* 241 */         if (type.equalsIgnoreCase("1") || (type.equalsIgnoreCase("2") && compare_date(file_date, file_date1))) {
///* 242 */           file_code = file_code1;
///* 243 */           entity_file_name = file_name1;
///* 244 */           file_date = file_date1;
///*     */         }
///*     */
///* 247 */         style = "";
///* 248 */         if (file_code.isEmpty()) {
///* 249 */           style = "display:none";
///*     */         }
///*     */
///*     */
///* 253 */         tbHtml.append("<td> ");
///* 254 */         tbHtml.append("<div id=\"uploadsuccess" + index + "\" style=" + style + " >");
///* 255 */         tbHtml.append("<input type=\"hidden\" id=\"fileNameHid" + index + "\" value=\"" + entity_file_name + "\"/>");
///* 256 */         tbHtml.append("<a id=\"content_downLoadFile" + index + "\" class=\"link_x\" href=\"/egrantweb/file/ajax-filedownload?fileCode=" + file_code + "\"  > ");
///* 257 */         tbHtml.append("<span name=\"org_attachs/org_attach[" + seq_no2 + "]/entity_file_name\" id=\"file_name" + index + "\">" + entity_file_name + "</span> </a>&nbsp;&nbsp;<br>");
///* 258 */         tbHtml.append("(上传时间<span id=\"file_date" + index + "\" name=\"org_attachs/org_attach[" + seq_no2 + "]/file_date\">" + file_date + "</span>)");
///* 259 */         if (!type.equalsIgnoreCase("0")) {
///* 260 */           tbHtml.append("<a href=\"###\"  onclick=\"delContent('" + this.tableId + "','" + index + "')\" class=\"link_x\">删除</a> </div> </td>");
///*     */         }
///*     */
///* 263 */         String fileType = IrisStringUtils.toString(MapUtils.getString(map, "FILE_TYPE"));
///* 264 */         String checkDescribe = (map.get("CHECK_DESCRIBE") == null) ? map.get("ATTACH_NAME").toString() : map.get("CHECK_DESCRIBE").toString();
///*     */
///* 266 */         tbHtml.append("<td style=\"text-align:center\"><div id=\"file" + index + "\"><input type=\"file\" name=\"filedata\"");
///* 267 */         if (!IrisStringUtils.isNullOrBlank(fileType)) {
///* 268 */           tbHtml.append(" fileType=\"" + fileType + "\"");
///*     */         }
///* 270 */         tbHtml.append(" /><input type=\"hidden\" name=\"org_attachs/org_attach[" + seq_no2 + "]/type\"  value=" + type + "><input type=\"hidden\" name=\"org_attachs/org_attach[" + seq_no2 + "]/file_code\"  id=\"file_code" + index + "\"  value=" + file_code + ">");
///*     */
///* 272 */         if (i == 0) {
///* 273 */           tbHtml.append("<input type=\"hidden\" id=\"sysDate2\" value=\"" + DateUtils.toString(new Date()) + "\" />");
///*     */         }
///* 275 */         tbHtml.append("</div></td>");
///*     */
///*     */       }
///*     */       else {
///*     */
///*     */
///* 281 */         inherit_attach_code = MapUtils.getString(map, "INHERIT_ATTACH_CODE");
///*     */
///* 283 */         if (StringUtils.isNotBlank(this.orgCode)) {
///* 284 */           Organization organization = ((SearchService)serviceFactory.getService(SearchService.class)).findOrganization(this.orgCode);
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///* 292 */           if (organization.getNutureType() != null && organization.getNutureType().indexOf("B") == 0 && "1".equals(organization.getOrgNoType())) {
///* 293 */             inherit_attach_code = MapUtils.getString(transform, inherit_attach_code);
///*     */           }
///*     */         }
///*     */
///* 297 */         String inheritSource = MapUtils.getString(map, "INHERIT_SOURCE");
///* 298 */         if (!IrisStringUtils.isNullOrBlank(inherit_attach_code) && "organization".equals(inheritSource)) {
///* 299 */           String[] seq = inherit_attach_code.split(",");
///* 300 */           for (String num : seq) {
///* 301 */             if (!XMLHelper.getNodeValueFromXML(this.orgDoc, "/data/org_attachs/org_attach[@seq_no='" + num + "' and @type='" + orgType + "']/file_code").equals("")) {
///* 302 */               file_code = XMLHelper.getNodeValueFromXML(this.orgDoc, "/data/org_attachs/org_attach[@seq_no='" + num + "' and @type='" + orgType + "']/file_code");
///* 303 */               entity_file_name = XMLHelper.getNodeValueFromXML(this.orgDoc, "/data/org_attachs/org_attach[@seq_no='" + num + "' and @type='" + orgType + "']/entity_file_name");
///* 304 */               file_date = XMLHelper.getNodeValueFromXML(this.orgDoc, "/data/org_attachs/org_attach[@seq_no='" + num + "' and @type='" + orgType + "']/file_date");
///*     */             }
///*     */           }
///* 307 */         } else if (!IrisStringUtils.isNullOrBlank(inherit_attach_code) && !"organization".equals(inheritSource) &&
///* 308 */           !XMLHelper.getNodeValueFromXML(this.psnDoc, "/data/content/content[@seq_no='" + inherit_attach_code + "']/file_code").equals("")) {
///* 309 */           file_code = XMLHelper.getNodeValueFromXML(this.orgDoc, "/data/content/content[@seq_no='" + inherit_attach_code + "']/file_code");
///* 310 */           entity_file_name = XMLHelper.getNodeValueFromXML(this.orgDoc, "/data/content/content[@seq_no='" + inherit_attach_code + "']/file_name");
///* 311 */           file_date = XMLHelper.getNodeValueFromXML(this.orgDoc, "/data/content/content[@seq_no='" + inherit_attach_code + "']/file_date");
///*     */         }
///*     */
///*     */
///*     */
///*     */
///*     */
///* 318 */         String file_code_rehis1 = XMLHelper.getNodeValueFromXML(doc, "/data/content/content[@seq_no=" + index + "]/file_code_rehis");
///*     */
///* 320 */         String file_code_his1 = XMLHelper.getNodeValueFromXML(doc, "/data/content/content[@seq_no=" + index + "]/file_code_his");
///* 321 */         String file_name_his1 = XMLHelper.getNodeValueFromXML(doc, "/data/content/content[@seq_no=" + index + "]/file_name_his");
///* 322 */         String file_date_his1 = XMLHelper.getNodeValueFromXML(doc, "/data/content/content[@seq_no=" + index + "]/file_date_his");
///*     */
///* 324 */         String file_code1 = XMLHelper.getNodeValueFromXML(doc, "/data/content/content[@seq_no=" + index + "]/file_code");
///* 325 */         String file_name1 = XMLHelper.getNodeValueFromXML(doc, "/data/content/content[@seq_no=" + index + "]/file_name");
///* 326 */         String file_date1 = XMLHelper.getNodeValueFromXML(doc, "/data/content/content[@seq_no=" + index + "]/file_date");
///*     */
///* 328 */         String file_code_pre1 = XMLHelper.getNodeValueFromXML(doc, "/data/content/content[@seq_no=" + index + "]/file_code_pre");
///* 329 */         String file_name_pre1 = XMLHelper.getNodeValueFromXML(doc, "/data/content/content[@seq_no=" + index + "]/file_name_pre");
///* 330 */         String file_date_pre1 = XMLHelper.getNodeValueFromXML(doc, "/data/content/content[@seq_no=" + index + "]/file_date_pre");
///*     */
///*     */
///* 333 */         long SEQNO = Long.parseLong(map.get("SEQNO").toString()) + 1L;
///* 334 */         tbHtml.append("<tr><input type=\"hidden\" id=\"seq_no_" + index + "\" name=\"content/content[" + seq_no + "]@seq_no\" value=" + index + " /><td  style=\"text-align:center\"><span id=\"attach_seq" + index + "\">" + SEQNO + "</span></td>");
///*     */
///*     */
///*     */
///*     */
///* 339 */         tbHtml.append("<td><span id=\"name" + index + "\" name='content/content[" + seq_no + "]/name'>" + map.get("ATTACH_NAME").toString() + "</span><span name=\"content/content[" + seq_no + "]/check_describe\" style=\"display:none\"  id=\"check_describe" + index + "\">" + IrisStringUtils.toString(MapUtils.getString(map, "CHECK_DESCRIBE")) + "</span>");
///*     */
///* 341 */         tbHtml.append(getAttachTemplatesHtml(this.attachType, index, seq_no, attachTemplates, MapUtils.getString(map, "SAMPLE_WORD"), MapUtils.getString(map, "SAMPLE_DESCRIBE"), res));
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///* 351 */         if (i == 0) {
///* 352 */           tbHtml.append("<input type=\"hidden\" id=\"sysDate2\" value=\"" + DateUtils.toString(new Date()) + "\" />");
///*     */         }
///* 354 */         tbHtml.append("</td>");
///*     */
///*     */
///*     */
///*     */
///* 359 */         if (berif.equalsIgnoreCase("1") || (berif.equalsIgnoreCase("2") && this.natureValue.substring(0, 1).equalsIgnoreCase("A"))) {
///* 360 */           tbHtml.append("<td style=\"text-align:center\"><span id=\"berif" + index + "\" name=\"content/content[" + seq_no + "]/berif\">是</span></td>");
///* 361 */         } else if (berif.equalsIgnoreCase("3")) {
///* 362 */           tbHtml.append("<td style=\"text-align:center\"><span id=\"berif" + index + "\" name=\"content/content[" + seq_no + "]/berif\">条件判断 </span></td>");
///*     */         } else {
///* 364 */           tbHtml.append("<td style=\"text-align:center\"><span id=\"berif" + index + "\" name=\"content/content[" + seq_no + "]/berif\">否</span></td>");
///*     */         }
///*     */
///*     */
///*     */
///* 369 */         if (!this.status.equalsIgnoreCase("10")) {
///* 370 */           style = "display:none";
///*     */         }
///*     */
///* 373 */         tbHtml.append("<td style=" + style + "><span name=\"content/content[" + seq_no + "]/berif_his\" id=\"berif_his" + index + "\"></span></td>");
///* 374 */         tbHtml.append("<td style=" + style + "><div id=\"uploadsuccess_his" + index + "\" style=\"display:none\">");
///*     */
///* 376 */         if (file_code_rehis1.isEmpty() && this.status.equalsIgnoreCase("10")) {
///* 377 */           file_code_rehis1 = file_code1;
///* 378 */           file_code_his1 = file_code1;
///* 379 */           file_name_his1 = file_name1;
///* 380 */           file_date_his1 = file_date1;
///*     */         }
///*     */
///*     */
///* 384 */         tbHtml.append("<a href=\"/egrantweb/file/ajax-filedownload?fileCode=" + file_code_his1 + "\"  class=\"link_x\" >");
///* 385 */         tbHtml.append("<span id=\"file_name_his" + index + "\" name=\"content/content[" + seq_no + "]/file_name_his\">" + file_name_his1 + "</span></a>&nbsp;&nbsp;<br>");
///* 386 */         tbHtml.append("(上传时间<span id=\"file_date_his" + index + "\" name=\"content/content[" + seq_no + "]/file_date_his\">" + file_date_his1 + "</span>) ");
///* 387 */         tbHtml.append("<span id=\"file_code_his" + index + "\" name=\"content/content[" + seq_no + "]/file_code_his\" style=\"display:none\">" + file_code_his1 + "</span>");
///* 388 */         tbHtml.append("<input type=\"hidden\" id=\"file_code_rehis" + index + "\" name=\"content/content[" + seq_no + "]/file_code_rehis\" value=" + file_code_rehis1 + "></div>");
///*     */
///*     */
///* 391 */         style = "";
///* 392 */         if (file_code_pre1.isEmpty()) {
///* 393 */           style = "display:none";
///*     */         }
///*     */
///*     */
///* 397 */         tbHtml.append("<div id=\"uploadsuccess_pre" + index + "\" style=" + style + " >");
///* 398 */         tbHtml.append("<input type=\"hidden\" id=\"file_code_pre" + index + "\" name=\"content/content[" + seq_no + "]/file_code_pre\" value=" + file_code_pre1 + ">");
///* 399 */         tbHtml.append("<a id=\"content_downLoadFile_pre" + index + "\" class=\"link_x\" href=\"/egrantweb/file/ajax-filedownload?fileCode=" + file_code_pre1 + "\"> ");
///* 400 */         tbHtml.append("<span name=\"content/content[" + seq_no + "]/file_name_pre\" id=\"file_name_pre" + index + "\">" + file_name_pre1 + "</span></a>&nbsp;&nbsp;<br>");
///* 401 */         tbHtml.append("(上传时间<span id=\"file_date_pre" + index + "\" name=\"content/content[" + seq_no + "]/file_date_pre\">" + file_date_pre1 + "</span>) </div> </td>");
///*     */
///*     */
///*     */
///* 405 */         if (type.equalsIgnoreCase("0") || (type.equalsIgnoreCase("2") && compare_date(file_date, file_date1))) {
///* 406 */           file_code = file_code1;
///* 407 */           entity_file_name = file_name1;
///* 408 */           file_date = file_date1;
///*     */         }
///*     */
///* 411 */         style = "";
///* 412 */         if (file_code.isEmpty()) {
///* 413 */           style = "display:none";
///*     */         }
///*     */
///*     */
///* 417 */         tbHtml.append("<td> ");
///* 418 */         tbHtml.append("<div id=\"uploadsuccess" + index + "\" style=" + style + " >");
///* 419 */         tbHtml.append("<input type=\"hidden\" id=\"fileNameHid" + index + "\" value=\"" + entity_file_name + "\"/>");
///* 420 */         tbHtml.append("<a id=\"content_downLoadFile" + index + "\" class=\"link_x\" href=\"/egrantweb/file/ajax-filedownload?fileCode=" + file_code + "\"  > ");
///* 421 */         tbHtml.append("<span name=\"content/content[" + seq_no + "]/file_name\" id=\"file_name" + index + "\">" + entity_file_name + "</span> </a>&nbsp;&nbsp;<br>");
///* 422 */         tbHtml.append("(上传时间<span id=\"file_date" + index + "\" name=\"content/content[" + seq_no + "]/file_date\">" + file_date + "</span>)");
///* 423 */         if (IrisStringUtils.isNullOrBlank(this.tableId)) {
///* 424 */           this.tableId = "prpContent_upload";
///*     */         }
///* 426 */         if (!type.equalsIgnoreCase("1")) {
///* 427 */           tbHtml.append("<a href=\"###\"  onclick=\"delContent('" + this.tableId + "','" + index + "')\" class=\"link_x\">删除</a> </div> </td>");
///*     */         }
///*     */
///*     */
///*     */
///* 432 */         if (type.equalsIgnoreCase("1")) {
///* 433 */           tbHtml.append("<td style=\"text-align:center\"><input type=\"hidden\" name=\"content/content[" + seq_no + "]/type\"  value=" + type + "><input type=\"hidden\" name=\"content/content[" + seq_no + "]/file_code\" id=\"file_code" + index + "\"  value=" + file_code + ">" + "<input type=\"hidden\" name=\"content/content[" + seq_no + "]/is_split\" id=\"is_split" + index + "\"  value=" + isSplit + "> 管理员上传</td> ");
///*     */         }
///*     */         else {
///*     */
///* 437 */           tbHtml.append("<td style=\"text-align:center\"><div id=\"file" + index + "\"><input type=\"file\" name=\"filedata\"");
///* 438 */           String fileType = IrisStringUtils.toString(MapUtils.getString(map, "FILE_TYPE"));
///* 439 */           if (!IrisStringUtils.isNullOrBlank(fileType)) {
///* 440 */             tbHtml.append(" fileType=\"" + fileType + "\"");
///*     */           }
///* 442 */           tbHtml.append(" /><input type=\"hidden\" name=\"content/content[" + seq_no + "]/type\"  value=" + type + "><input type=\"hidden\" name=\"content/content[" + seq_no + "]/file_code\" id=\"file_code" + index + "\"  value=" + file_code + ">" + "<input type=\"hidden\" name=\"content/content[" + seq_no + "]/is_split\" id=\"is_split" + index + "\"  value=" + isSplit + "></div></td>");
///*     */         }
///*     */       }
///*     */     }
///*     */
///*     */
///*     */
///*     */
///* 450 */     return tbHtml.toString();
///*     */   }
///*     */
///*     */
///*     */   private String getIconByFileName(String fileName, String res) {
///* 455 */     String end = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length());
///* 456 */     String image = "";
///* 457 */     if ("doc".equalsIgnoreCase(end) || "docx".equalsIgnoreCase(end)) {
///* 458 */       image = "<img src=\"" + res + "/images/ico_word.gif\"/>";
///*     */     }
///* 460 */     else if ("pdf".equalsIgnoreCase(end)) {
///* 461 */       image = "<img  src=\"" + res + "/images/ico_pdf.gif\"/>";
///* 462 */     } else if ("wps".equalsIgnoreCase(end)) {
///* 463 */       image = "<img src=\"" + res + "/images/ico_wps.gif\"/>";
///* 464 */     } else if ("xls".equalsIgnoreCase(end) || "xlsx".equalsIgnoreCase(end)) {
///* 465 */       image = "<img src=\"" + res + "/images/excel.gif\"/>";
///*     */     }
///* 467 */     return image;
///*     */   }
///*     */
///*     */   private String getAttachTemplatesHtml(String attachType, String index, String seq_no, List<Map<String, Object>> attachTemplates, String sampleWord, String sampleDescribe, String res) {
///* 471 */     if ((attachTemplates == null || attachTemplates.size() == 0) && IrisStringUtils.isNullOrBlank(sampleWord) && IrisStringUtils.isNullOrBlank(sampleDescribe)) {
///* 472 */       return "";
///*     */     }
///* 474 */     StringBuilder xml = new StringBuilder("");
///*     */
///* 476 */     for (int i = 0; i < attachTemplates.size(); i++) {
///* 477 */       Map<String, Object> attachTemplate = attachTemplates.get(i);
///* 478 */       String img = getIconByFileName(MapUtils.getString(attachTemplate, "FILE_NAME"), res);
///* 479 */       String imgTmp = new String(img);
///* 480 */       img = img.substring(img.indexOf("\"") + 1, img.lastIndexOf("\""));
///* 481 */       String fileName = MapUtils.getString(attachTemplate, "FILE_NAME").substring(0, MapUtils.getString(attachTemplate, "FILE_NAME").lastIndexOf("."));
///* 482 */       if ("organization".equals(attachType)) {
///* 483 */         xml.append("<input type=\"hidden\" name=\"org_attachs/org_attach[" + seq_no + "]/attach_template[0" + i + "]/template_file_code\"  id=\"template_file_code_" + index + "_" + i + "\"  value=\"" + MapUtils.getString(attachTemplate, "FILE_CODE") + "\"/>");
///*     */
///* 485 */         xml.append("<input type=\"hidden\" name=\"org_attachs/org_attach[" + seq_no + "]/attach_template[0" + i + "]/template_name\" id=\"template_name_" + index + "_" + i + "\"  value=\"" + fileName + "\"/>");
///* 486 */         xml.append("<input type=\"hidden\" name=\"org_attachs/org_attach[" + seq_no + "]/attach_template[0" + i + "]/template_img\" id=\"template_img_" + index + "_" + i + "\"  value=\"" + img + "\"/>");
///*     */       } else {
///* 488 */         xml.append("<input type=\"hidden\" name=\"content/content[" + seq_no + "]/attach_template[0" + i + "]/template_file_code\" id=\"template_file_code_" + index + "_" + i + "\"  value=\"" + MapUtils.getString(attachTemplate, "FILE_CODE") + "\"/>");
///*     */
///* 490 */         xml.append("<input type=\"hidden\" name=\"content/content[" + seq_no + "]/attach_template[0" + i + "]/template_name\" id=\"template_name_" + index + "_" + i + "\"  value=\"" + fileName + "\"/>");
///* 491 */         xml.append("<input type=\"hidden\" name=\"content/content[" + seq_no + "]/attach_template[0" + i + "]/template_img\" id=\"template_img_" + index + "_" + i + "\"  value=\"" + img + "\"/>");
///*     */       }
///* 493 */       xml.append("&nbsp;&nbsp;<a class=\"link_x\"  href=\"/egrantweb/file/ajax-filedownload?fileCode=").append(MapUtils.getString(attachTemplate, "FILE_CODE") + "\">").append(imgTmp + fileName + "</a>");
///*     */     }
///* 495 */     if (!IrisStringUtils.isNullOrBlank(sampleWord) && !IrisStringUtils.isNullOrBlank(sampleDescribe)) {
///* 496 */       String img = getIconByFileName(sampleWord, res);
///* 497 */       String imgTmp = new String(img);
///* 498 */       img = img.substring(img.indexOf("\"") + 1, img.lastIndexOf("\""));
///* 499 */       if ("organization".equals(attachType)) {
///* 500 */         xml.append("<input type=\"hidden\" name=\"org_attachs/org_attach[" + seq_no + "]/attach_template[0" + (attachTemplates.size() + 1) + "]/template_sample_word\" id=\"template_sample_word_" + index + "_" + Character.MIN_VALUE + "\"  value=\"" + sampleWord + "\"/>");
///*     */
///* 502 */         xml.append("<input type=\"hidden\" name=\"org_attachs/org_attach[" + seq_no + "]/attach_template[0" + (attachTemplates.size() + 1) + "]/template_name\" id=\"template_name_" + index + "_" + Character.MIN_VALUE + "\"  value=\"" + sampleDescribe + "\"/>");
///*     */
///* 504 */         xml.append("<input type=\"hidden\" name=\"org_attachs/org_attach[" + seq_no + "]/attach_template[0" + (attachTemplates.size() + 1) + "]/template_img\" id=\"template_img_" + index + "_" + Character.MIN_VALUE + "\"  value=\"" + img + "\"/>");
///*     */       } else {
///*     */
///* 507 */         xml.append("<input type=\"hidden\" name=\"content/content[" + seq_no + "]/attach_template[0" + (attachTemplates.size() + 1) + "]/template_sample_word\" id=\"template_sample_word_" + index + "_" + Character.MIN_VALUE + "\"  value=\"" + sampleWord + "\"/>");
///*     */
///* 509 */         xml.append("<input type=\"hidden\" name=\"content/content[" + seq_no + "]/attach_template[0" + (attachTemplates.size() + 1) + "]/template_name\" id=\"template_name_" + index + "_" + Character.MIN_VALUE + "\"  value=\"" + sampleDescribe + "\"/>");
///*     */
///* 511 */         xml.append("<input type=\"hidden\" name=\"content/content[" + seq_no + "]/attach_template[0" + (attachTemplates.size() + 1) + "]/template_img\" id=\"template_img_" + index + "_" + Character.MIN_VALUE + "\"  value=\"" + img + "\"/>");
///*     */       }
///*     */
///* 514 */       xml.append("&nbsp;&nbsp;<a class=\"link_x\" onclick=\"return ContentDownDesc('" + sampleWord + "');\" href=\"###\">").append(imgTmp + sampleDescribe + "</a>");
///*     */     }
///* 516 */     return xml.toString();
///*     */   }
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */
///*     */   public boolean compare_date(String date1, String date2) {
///* 527 */     if (date2 == null || date2.equalsIgnoreCase("")) {
///* 528 */       return false;
///*     */     }
///* 530 */     if (date1 == null || date1.equalsIgnoreCase("")) {
///* 531 */       return true;
///*     */     }
///*     */
///* 534 */     DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm");
///*     */
///*     */     try {
///* 537 */       Date dt1 = df.parse(date1);
///* 538 */       Date dt2 = df.parse(date2);
///* 539 */       if (dt2.getTime() > dt1.getTime()) {
///* 540 */         return true;
///*     */       }
///* 542 */     } catch (Exception exception) {
///* 543 */       exception.printStackTrace();
///*     */     }
///* 545 */     return false;
///*     */   }
///*     */
///*     */
///*     */   public String getGrantCode() {
///* 550 */     return this.grantCode;
///*     */   }
///*     */
///*     */   public void setGrantCode(String grantCode) {
///* 554 */     this.grantCode = grantCode;
///*     */   }
///*     */
///*     */   public String getNatureValue() {
///* 558 */     return this.natureValue;
///*     */   }
///*     */
///*     */   public void setNatureValue(String natureValue) {
///* 562 */     this.natureValue = natureValue;
///*     */   }
///*     */
///*     */   public String getStatus() {
///* 566 */     return this.status;
///*     */   }
///*     */
///*     */   public void setStatus(String status) {
///* 570 */     this.status = status;
///*     */   }
///*     */
///*     */   public String getXmlData() {
///* 574 */     return this.xmlData;
///*     */   }
///*     */
///*     */   public void setXmlData(String xmlData) {
///* 578 */     this.xmlData = xmlData;
///*     */   }
///*     */
///*     */   public String getFormCode() {
///* 582 */     return this.formCode;
///*     */   }
///*     */
///*     */   public void setFormCode(String formCode) {
///* 586 */     this.formCode = formCode;
///*     */   }
///*     */
///*     */   public String getAttachType() {
///* 590 */     return this.attachType;
///*     */   }
///*     */
///*     */   public void setAttachType(String attachType) {
///* 594 */     this.attachType = attachType;
///*     */   }
///*     */
///*     */   public String getTableId() {
///* 598 */     return this.tableId;
///*     */   }
///*     */
///*     */   public void setTableId(String tableId) {
///* 602 */     this.tableId = tableId;
///*     */   }
///*     */
///*     */   public String getOrgCode() {
///* 606 */     return this.orgCode;
///*     */   }
///*     */
///*     */   public void setOrgCode(String orgCode) {
///* 610 */     this.orgCode = orgCode;
///*     */   }
///*     */
///*     */   public Document getOrgDoc() {
///* 614 */     return this.orgDoc;
///*     */   }
///*     */
///*     */   public void setOrgDoc(Document orgDoc) {
///* 618 */     this.orgDoc = orgDoc;
///*     */   }
///*     */
///*     */   public Document getPsnDoc() {
///* 622 */     return this.psnDoc;
///*     */   }
///*     */
///*     */   public void setPsnDoc(Document psnDoc) {
///* 626 */     this.psnDoc = psnDoc;
///*     */   }
///*     */
///*     */   public String getPsnCode() {
///* 630 */     return this.psnCode;
///*     */   }
///*     */
///*     */   public void setPsnCode(String psnCode) {
///* 634 */     this.psnCode = psnCode;
///*     */   }
///*     */
///*     */   public String getTitle() {
///* 638 */     return this.title;
///*     */   }
///*     */
///*     */   public void setTitle(String title) {
///* 642 */     this.title = title;
///*     */   }
///*     */ }
//
//
///* Location:              D:\文件kjt\WEB-INF\lib\egrant-core-2.2.20240205.1659.jar!\com\iris\egrant\web\struts2\tags\AttachTag.class
// * Java compiler version: 6 (50.0)
// * JD-Core Version:       1.1.3
// */